/************************************************
 * Copyright (c) 2007 ~ 2009, 
 * All rights reserved.
 * Version   : 1.0
 * Author    : lengsh@gmail.com 
 * Date      : 2009.1.2
 ************************************************/

#ifndef   __PANDA_ISTORAGE_H___
#define   __PANDA_ISTORAGE_H___

#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <signal.h>
#include <unistd.h>
#include <glib.h>
#include "define.h"

using namespace std;
class IStorage{
public:
	IStorage(){}
	virtual ~IStorage(){}
	virtual bool Initialize(const char *conf) = 0;
	virtual int Read(int ihash, GHashTable *kv) = 0;
	virtual int Atom(int ihash, const char *key, int &ival, bool bselect = false) = 0;
	virtual int Write(int ihash, GHashTable *kv)  = 0;
	virtual int Delete(int ihash, GHashTable *kv) = 0;
        virtual int SQL(int ihash, const char *data, unsigned dlen, char **wbuf,unsigned &wsize, unsigned &wbytes) = 0;

};

#endif  // __PANDA_ISTORAGE_H___
